# -*- coding =utf-8 -*-
# @Time : 2022/9/15 9:27
# @Author :1814-09胡海燕
# @File : 4-2.py
# @Software : PyCharm
# 读取a.txt（a中有多行文本）中的文本并打印到屏幕上
f = open("a.txt", "w")
f.write("hello world\n1814-09\nHuhaiyan")
f = open("a.txt", "r")  # 只读取
content = f.readlines()  # 读取整个文档
i = 1
for temp in content:
    print("%d:%s" % (i, temp))
    i += 1
f.close()
